package com.lagou.edu.remote;

import com.lagou.edu.dto.PromotionAdDTO;
import com.lagou.edu.dto.PromotionSpaceDTO;
import com.lagou.edu.util.ResponseDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 远程调用 edu-ad-boot-impl 的接口
 */

@FeignClient(name = "lagou-edu-ad", path = "/ad")
public interface AdRemoteService {

    @GetMapping("/space/list")
    List<PromotionSpaceDTO> getAllSpaces();

    @GetMapping("/space/getAdBySpaceKey")
    List<PromotionSpaceDTO> getAdBySpaceKey(@RequestParam("spaceKey")String[] spaceKey);

    @PostMapping("/space/saveOrUpdate")
    ResponseDTO saveOrUpdateSpace(PromotionSpaceDTO spaceDTO);

    @GetMapping("/space/getSpaceById")
    PromotionSpaceDTO getSpaceById(@RequestParam("id") Integer id);

    @GetMapping("/getAllAds")
    List<PromotionAdDTO> getAllAds();
}
